package com.hdax.dm.service.impl;

import com.hdax.dm.common.utils.CommonResponse;
import com.hdax.dm.common.utils.ResponseUtil;
import com.hdax.dm.dtos.user.LinkUserDto;
import com.hdax.dm.feign.order.LinkUserFeign;
import com.hdax.dm.mapstructs.LinkUserDtoMapper;
import com.hdax.dm.service.LinkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LinkUserServiceImpl implements LinkUserService {

    @Autowired
    private LinkUserFeign linkUserFeign;
    @Autowired
    private LinkUserDtoMapper linkUserDtoMapper;
    @Override
    public CommonResponse<List<LinkUserDto>> ticketBuyerList(Long userId) {
        return ResponseUtil.returnSuccess(linkUserDtoMapper.toTargetList(linkUserFeign.linkUsers(userId)));
    }
}
